# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=podofo
pkgver=0.9.8
pkgrel=0
pkgdesc="A C++ library to work with the PDF file format"
url="http://podofo.sourceforge.net/"
arch="all"
license="GPL-2.0-only"
makedepends="tiff-dev libpng-dev fontconfig-dev
	cmake lua-dev openssl1.1-compat-dev libidn-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://downloads.sourceforge.net/podofo/podofo-$pkgver.tar.gz"

# secfixes:
#   0.9.7-r0:
#     - CVE-2019-9199
#     - CVE-2019-9687
#     - CVE-2018-19532
#     - CVE-2018-20751
#     - CVE-2018-20797
#     - CVE-2019-10723
#     - CVE-2019-20093
#   0.9.6-r0:
#     - CVE-2017-6848
#     - CVE-2017-7378
#     - CVE-2017-7379
#     - CVE-2017-7380
#     - CVE-2017-7381
#     - CVE-2017-7382
#     - CVE-2017-7383
#     - CVE-2017-7994
#     - CVE-2017-8053
#     - CVE-2017-8054
#     - CVE-2017-8378
#     - CVE-2017-8787
#     - CVE-2018-5295
#     - CVE-2018-5296
#     - CVE-2018-5308
#     - CVE-2018-5309
#     - CVE-2018-5783
#     - CVE-2018-6352
#     - CVE-2018-8000
#     - CVE-2018-8001
#     - CVE-2018-8002
#     - CVE-2018-11254
#     - CVE-2018-11255
#     - CVE-2018-11256
#     - CVE-2018-12982
#     - CVE-2018-12983
#   0.9.5-r0:
#     - CVE-2017-6843
#     - CVE-2017-6844
#     - CVE-2017-6845
#     - CVE-2017-6846
#     - CVE-2017-6847
#     - CVE-2017-6849

build() {
	cmake -B build . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DPODOFO_BUILD_SHARED=1 \
		-DPODOFO_HAVE_JPEG_LIB=1 \
		-DPODOFO_HAVE_PNG_LIB=1 \
		-DPODOFO_HAVE_TIFF_LIB=1
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="
b220322114450f1656c73d325f5172bc4cec0b1913e98b4eb2455f8ed7394bcaa47438d41003c9678937ef44d411e135431ddd6784f83d3663337d471baa02b1  podofo-0.9.8.tar.gz
"
